import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeContainerComponent } from './component';

const routes: Routes = [
  {
    path: '',
    component: HomeContainerComponent,
    children: [
      // 重定向中的recommend相当于给了一个默认值给tabLink，当tabLink没有传值时，则tabLink就为recommend
      {
        path: '',
        redirectTo: 'recommend',
        pathMatch: 'full',
      },
      {
        path: ':tabLink',
        component: HomeContainerComponent,
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class HomeRoutingModule {}
